
import * as mysql from 'mysql';

export default function getDb() {
    const connect = mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: 'l2755582',
        // database: 'my_db'
    });
    connect.connect((error) => {
        if (error) {
            throw error;
        }
        console.log('-------------数据库连接成功-------------');
    });
    return connect;
}

